﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Collection.Entities;

namespace Collection.Interfaces
{
	public interface IMerchandiseService : IServiceBase<Merchandise>
	{
		/// <summary>
		/// 添加商品
		/// </summary>
		/// <param name="item">商品实体</param>
		void AddMerchandise(Merchandise merchandise);

		/// <summary>
		/// 是否已经存在同样的商品
		/// </summary>
		/// <param name="itemId">商品编号</param>
		/// <param name="catalogId">商品类目Id</param>
		/// <returns>存在：true,不存在：false</returns>
		Boolean HasMerchandise(Int64 catalogId, Int64 itemId);

		/// <summary>
		/// 更新商品信息
		/// </summary>
		/// <param name="item">最新的商品数据（业务）实体</param>
		void UpdateMerchandise(Merchandise merchandise);

		/// <summary>
		/// 批量获取商品信息
		/// </summary>
		/// <param name="index">当前页码</param>
		/// <param name="pageSize">页大小</param>
		/// <returns></returns>
		List<Merchandise> GetMerchandises(Int32 index, Int32 pageSize);

		/// <summary>
		/// 获取产品的数量
		/// </summary>
		Int64 Count { get; }
	}
}
